package com.googlecode.jmicroerp.wicket.administrare;

import com.googlecode.jmicroerp.model.Magazin;
import com.googlecode.jmicroerp.wicket.DefaultViewPage;
import com.googlecode.jmicroerp.wicket.components.grid.ActionButton;
import com.googlecode.jmicroerp.wicket.components.grid.ActionButtons;
import com.googlecode.jmicroerp.wicket.components.grid.ColumnModel;
import com.googlecode.jmicroerp.wicket.components.grid.DefaultGridAction;
import com.googlecode.jmicroerp.wicket.components.grid.Grid;
import com.googlecode.jmicroerp.wicket.components.grid.PageParameters;
import java.util.Arrays;
import java.util.List;
import org.apache.wicket.spring.injection.annot.SpringBean;

/**
 *
 * @author alex
 */
public class VizualizareMagazinePage extends DefaultViewPage {
    @SpringBean(name = "defaultGridAction")
    private DefaultGridAction<Magazin> gridAction;
    
    public VizualizareMagazinePage() {
        ColumnModel[] grids = {
            new ColumnModel("Denumire", "denumire", String.class),
            new ColumnModel("Adresa", "adresa", String.class)
        };
        List<ColumnModel> columns = Arrays.asList(grids);
        ActionButton actionButton = new ActionButton(new PageParameters(EditareMagazinePage.class));
        ActionButtons actionButtons = new ActionButtons(actionButton);
        Grid<Magazin> dataGridConsum = new Grid<Magazin>("grid", columns, Magazin.class, gridAction, actionButtons);
        add(dataGridConsum);
    }
}
